﻿myApp.factory('previewService', function () {
    var list = [];

    return {
        addItem: addItem,
        getList: getList
    };

    function addItem(item) {
        list.push(item);
    }

    function getList() {
        return list;
    }
});
   

    //return {
    //    addPreviewBlog: function (newObj) {
    //        $rootScope.previewBlog.push(newObj);
    //        alert("After push: " + JSON.stringify($rootScope.previewBlog));
    //    },

    //    getPreviewBlog: function () {
    //        return $rootScope.previewBlog;
    //    },

    //    clearBlog: function () {
    //        $rootScope.previewBlog = [];
    //    }

    //}


